<!DOCTYPE html>
<html lang="zh-cn">
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no"/>
    <meta name="renderer" content="webkit">
    <title></title>
    <link rel="stylesheet" href="css/pintuer.css">
    <link rel="stylesheet" href="css/admin.css">
    <script src="js/jquery.js"></script>
    <script src="js/pintuer.js"></script>
</head>
<body>
<div class="panel admin-panel">
    <div class="panel-head"><strong><span class="icon-key"></span> 新增权限</strong></div>
    <div class="body-content">
        <form method="post" class="form-x" action="">

            <div class="form-group">
                <div class="label">
                    <label>权限名称</label>
                </div>
                <div class="field">
                    <input type="text" class="input w50" id="permName" name="permName" size="50"/>
                </div>
            </div>
            <div class="form-group">
                <div class="label">
                    <label>权限描述</label>
                </div>
                <div class="field">
                    <input type="text" class="input w50" id="permDes" name="permDes" size="100"/>
                </div>
            </div>

            <div class="form-group">
                <div class="label">
                    <label></label>
                </div>
                <div class="field">
                    <input id="submit" class="button bg-main icon-check-square-o" type="button" value="提交">
                </div>
            </div>
        </form>
    </div>
</div>
<script>
    $("#submit").click(function () {
        var data = {
            "perName": $("#permName").val(),"perDes": $("#permDes").val()
        }
        $.ajax({
            "url":"/RolePermission/addPer",
            "type": "POST",
            "data": JSON.stringify(data),
            "dataType": "json",
            "contentType": "application/json; charset=utf-8",
            "success": function (resp) {
                if(resp.code==0){
                    location.href="/html/permListNew.html"
                }else{
                    alert(resp.msg)
                }
            }
        })
    })



</script>
</body>
</html>